package com.yyb.mapper;

import com.yyb.domain.SysUser;
import com.yyb.dto.SysUserQueryDTO;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

/**
 * @author LJH
 * @description 针对表【sys_user(用户信息表)】的数据库操作Mapper
 * @createDate 2024-02-21 21:08:30
 * @Entity com.yyb.domain.SysUser
 */
public interface SysUserMapper {

    int deleteByPrimaryKey(Long id);

    int insert(SysUser record);

    int insertSelective(SysUser record);

    SysUser selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SysUser record);

    int updateByPrimaryKey(SysUser record);

    /**
     * 用户登录
     *
     * @param username
     * @param password
     * @return
     */
    SysUser login(@Param("username") String username, @Param("password") String password);

    /**
     * 查询所有权限
     *
     * @return
     */
    List<String> queryAllPermissions();

    /**
     * 根据用户ID查询用户的权限
     *
     * @param userId
     * @return
     */
    List<String> queryPermissionsByUserId(@Param("userId") Long userId);

    /**
     * 根据条件查询用户数据
     * @param params
     * @return
     */
    List<SysUser> queryAllUsers(SysUserQueryDTO params);

    /**
     * 根据userIds取出所有用户数据
     * @param userIds
     * @return
     */
    List<SysUser> selectByPrimaryKeys(@Param("userIds") Set<Long> userIds);
}
